.class public abstract Lcom/burstly/lib/network/request/SafeAsyncTask;
.super Lcom/burstly/lib/util/PrioritizedAsyncTask;
.source "SafeAsyncTask.java"


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "<T:",
        "Ljava/lang/Object;",
        ">",
        "Lcom/burstly/lib/util/PrioritizedAsyncTask",
        "<TT;>;"
    }
.end annotation


# static fields
.field private static final LOG:Lcom/burstly/lib/util/LoggerExt; = null

.field private static final TAG:Ljava/lang/String; = "SafeAsyncTask"


# instance fields
.field private mBurstlyViewId:Ljava/lang/String;

.field private mHost:Ljava/lang/String;

.field private mOriginalName:Ljava/lang/String;

.field private mUri:Ljava/lang/String;

.field private mWorkerThread:Ljava/lang/Thread;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 39
    invoke-static {}, Lcom/burstly/lib/util/LoggerExt;->getInstance()Lcom/burstly/lib/util/LoggerExt;

    move-result-object v0

    sput-object v0, Lcom/burstly/lib/network/request/SafeAsyncTask;->LOG:Lcom/burstly/lib/util/LoggerExt;

    return-void
.end method

.method public constructor <init>()V
    .locals 0

    .prologue
    .line 34
    .local p0, this:Lcom/burstly/lib/network/request/SafeAsyncTask;,"Lcom/burstly/lib/network/request/SafeAsyncTask<TT;>;"
    invoke-direct {p0}, Lcom/burstly/lib/util/PrioritizedAsyncTask;-><init>()V

    return-void
.end method

.method private setThreadName()V
    .locals 3

    .prologue
    .line 120
    .local p0, this:Lcom/burstly/lib/network/request/SafeAsyncTask;,"Lcom/burstly/lib/network/request/SafeAsyncTask<TT;>;"
    iget-object v0, p0, Lcom/burstly/lib/network/request/SafeAsyncTask;->mWorkerThread:Ljava/lang/Thread;

    if-eqz v0, :cond_0

    .line 121
    iget-object v0, p0, Lcom/burstly/lib/network/request/SafeAsyncTask;->mWorkerThread:Ljava/lang/Thread;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    iget-object v2, p0, Lcom/burstly/lib/network/request/SafeAsyncTask;->mBurstlyViewId:Ljava/lang/String;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, " Host: "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget-object v2, p0, Lcom/burstly/lib/network/request/SafeAsyncTask;->mHost:Ljava/lang/String;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, ", Uri: "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget-object v2, p0, Lcom/burstly/lib/network/request/SafeAsyncTask;->mUri:Ljava/lang/String;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/Thread;->setName(Ljava/lang/String;)V

    .line 123
    :cond_0
    return-void
.end method


# virtual methods
.method protected getBurstlyViewId()Ljava/lang/String;
    .locals 1

    .prologue
    .line 129
    .local p0, this:Lcom/burstly/lib/network/request/SafeAsyncTask;,"Lcom/burstly/lib/network/request/SafeAsyncTask<TT;>;"
    iget-object v0, p0, Lcom/burstly/lib/network/request/SafeAsyncTask;->mBurstlyViewId:Ljava/lang/String;

    return-object v0
.end method

.method protected getHost()Ljava/lang/String;
    .locals 1

    .prologue
    .line 90
    .local p0, this:Lcom/burstly/lib/network/request/SafeAsyncTask;,"Lcom/burstly/lib/network/request/SafeAsyncTask<TT;>;"
    iget-object v0, p0, Lcom/burstly/lib/network/request/SafeAsyncTask;->mHost:Ljava/lang/String;

    return-object v0
.end method

.method protected getUri()Ljava/lang/String;
    .locals 1

    .prologue
    .line 105
    .local p0, this:Lcom/burstly/lib/network/request/SafeAsyncTask;,"Lcom/burstly/lib/network/request/SafeAsyncTask<TT;>;"
    iget-object v0, p0, Lcom/burstly/lib/network/request/SafeAsyncTask;->mUri:Ljava/lang/String;

    return-object v0
.end method

.method protected onPostExecute(Ljava/lang/Object;)V
    .locals 2
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(TT;)V"
        }
    .end annotation

    .prologue
    .line 82
    .local p0, this:Lcom/burstly/lib/network/request/SafeAsyncTask;,"Lcom/burstly/lib/network/request/SafeAsyncTask<TT;>;"
    .local p1, result:Ljava/lang/Object;,"TT;"
    iget-object v0, p0, Lcom/burstly/lib/network/request/SafeAsyncTask;->mWorkerThread:Ljava/lang/Thread;

    iget-object v1, p0, Lcom/burstly/lib/network/request/SafeAsyncTask;->mOriginalName:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/Thread;->setName(Ljava/lang/String;)V

    .line 83
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/burstly/lib/network/request/SafeAsyncTask;->mWorkerThread:Ljava/lang/Thread;

    .line 84
    return-void
.end method

.method protected performInBackground()Ljava/lang/Object;
    .locals 4
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()TT;"
        }
    .end annotation

    .prologue
    .line 73
    .local p0, this:Lcom/burstly/lib/network/request/SafeAsyncTask;,"Lcom/burstly/lib/network/request/SafeAsyncTask<TT;>;"
    invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;

    move-result-object v0

    iput-object v0, p0, Lcom/burstly/lib/network/request/SafeAsyncTask;->mWorkerThread:Ljava/lang/Thread;

    .line 74
    iget-object v0, p0, Lcom/burstly/lib/network/request/SafeAsyncTask;->mWorkerThread:Ljava/lang/Thread;

    invoke-virtual {v0}, Ljava/lang/Thread;->getName()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/burstly/lib/network/request/SafeAsyncTask;->mOriginalName:Ljava/lang/String;

    .line 75
    iget-object v0, p0, Lcom/burstly/lib/network/request/SafeAsyncTask;->mWorkerThread:Ljava/lang/Thread;

    new-instance v1, Lcom/burstly/lib/exception/BackgroundUncaughtExceptionHandler;

    invoke-direct {v1}, Lcom/burstly/lib/exception/BackgroundUncaughtExceptionHandler;-><init>()V

    invoke-virtual {v0, v1}, Ljava/lang/Thread;->setUncaughtExceptionHandler(Ljava/lang/Thread$UncaughtExceptionHandler;)V

    .line 76
    sget-object v0, Lcom/burstly/lib/network/request/SafeAsyncTask;->LOG:Lcom/burstly/lib/util/LoggerExt;

    const-string v1, "SafeAsyncTask"

    const-string v2, "Custom uncaughtExceptionHandler has been set."

    const/4 v3, 0x0

    new-array v3, v3, [Ljava/lang/Object;

    invoke-virtual {v0, v1, v2, v3}, Lcom/burstly/lib/util/LoggerExt;->logDebug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 77
    const/4 v0, 0x0

    return-object v0
.end method

.method protected setBurstlyViewId(Ljava/lang/String;)V
    .locals 0
    .parameter "burstlyViewId"

    .prologue
    .line 136
    .local p0, this:Lcom/burstly/lib/network/request/SafeAsyncTask;,"Lcom/burstly/lib/network/request/SafeAsyncTask<TT;>;"
    iput-object p1, p0, Lcom/burstly/lib/network/request/SafeAsyncTask;->mBurstlyViewId:Ljava/lang/String;

    .line 137
    invoke-direct {p0}, Lcom/burstly/lib/network/request/SafeAsyncTask;->setThreadName()V

    .line 138
    return-void
.end method

.method protected setHost(Ljava/lang/String;)V
    .locals 0
    .parameter "host"

    .prologue
    .line 97
    .local p0, this:Lcom/burstly/lib/network/request/SafeAsyncTask;,"Lcom/burstly/lib/network/request/SafeAsyncTask<TT;>;"
    iput-object p1, p0, Lcom/burstly/lib/network/request/SafeAsyncTask;->mHost:Ljava/lang/String;

    .line 98
    invoke-direct {p0}, Lcom/burstly/lib/network/request/SafeAsyncTask;->setThreadName()V

    .line 99
    return-void
.end method

.method protected setUri(Ljava/lang/String;)V
    .locals 0
    .parameter "uri"

    .prologue
    .line 112
    .local p0, this:Lcom/burstly/lib/network/request/SafeAsyncTask;,"Lcom/burstly/lib/network/request/SafeAsyncTask<TT;>;"
    iput-object p1, p0, Lcom/burstly/lib/network/request/SafeAsyncTask;->mUri:Ljava/lang/String;

    .line 113
    invoke-direct {p0}, Lcom/burstly/lib/network/request/SafeAsyncTask;->setThreadName()V

    .line 114
    return-void
.end method
